﻿using JetBrains.Annotations;
using Volo.Abp;

namespace Shared.Service.DataScopes.UserScopes
{
    /// <summary>
    /// 
    /// </summary>
    public class UserDataScope : BaseDataScope
    {
        public UserDataScope([NotNull] DataScopeInfo dataScopeInfo) : this(dataScopeInfo.ProviderKey,
            dataScopeInfo.ScopeType, dataScopeInfo.ScopeKeys)
        {

        }

        public UserDataScope([NotNull] string userId,
            DataScopeType scopeType, params string[] scopeKeys)
        {
            Check.NotNull(userId, nameof(userId));
            UserId = userId;
            ScopeType = scopeType;
            ScopeKeys = scopeKeys ?? new string[0];
        }

        public string UserId { get; set; }

        public override DataScopeType ScopeType { get; }
        public override string[] ScopeKeys { get; set; }
    }
}
